package me.ivps.android.testdemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class NextActivity extends Activity {
    
    public static final String EXTRAS_PAYLOAD_KEY = "me.ivps.android.testdemo.EXTRAS_PAYLOAD_KEY";
    
    /**
     * 返回 启动 Intent
     * 
     * @param context
     * @param payload
     * @return
     */
    public static Intent newIntent(LaunchActivity context, String payload) {
        return new Intent(context, NextActivity.class).putExtra(
                EXTRAS_PAYLOAD_KEY, payload);
    }
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.activity_next);
        
        final String payload = getIntent().getStringExtra(EXTRAS_PAYLOAD_KEY);
        if (payload != null) {
            ((TextView) findViewById(R.id.tv_info_text)).setText(payload);
        }
    }
}
